Enumerator (computer Science)
   HOME

TheInfoList



OR:

An enumerator is a
Turing machine A Turing machine is a mathematical model of computation describing an abstract machine that manipulates symbols on a strip of tape according to a table of rules. Despite the model's simplicity, it is capable of implementing any computer algori ...
with an attached printer. The Turing machine can use that printer as an output device to print strings. Every time the Turing machine wants to add a string to the list, it sends the string to the printer. Enumerator is a type of Turing machine variant and is equivalent with Turing machine.


Formal definition

An enumerator E can be defined as a 2-tape Turing machine (
Multitape Turing machine A multi-tape Turing machine is a variant of the Turing machine that utilizes several tapes. Each tape has its own head for reading and writing. Initially, the input appears on tape 1, and the others start out blank. This model intuitively seems mu ...
where k=2 ) whose language is \empty. Initially, E receives no input, and all the tapes are blank (i.e., filled with blank symbols). Newly defined symbol \#\in \Gamma\land\#\notin \Sigma is the delimiter that marks end of an element of S. The second tape can be regarded as the printer, strings on it are separated by \#. The language enumerated by an enumerator E denoted by L(E) is defined as set of the strings on the second tape (the printer).


Equivalence of Enumerator and Turing Machines

A language over a finite alphabet is Turing Recognizable if and only if it can be enumerated by an enumerator. This shows Turing recognizable languages are also recursively enumerable. Proof A Turing Recognizable language can be Enumerated by an Enumerator Consider a Turing Machine M and the language accepted by it be L(M). Since the set of all possible strings over the input alphabet \Sigma i.e. the Kleene Closure \Sigma^ is a countable set, we can enumerate the strings in it as s_,s_,\dots ,s_, etc. Then the Enumerator enumerating the language L(M) will follow the steps: 1 for i = 1,2,3,... 2 Run M with input strings s_, s_, \dots, s_ for i-steps 3 If any string is accepted, then print it. Now the question comes whether every string in the language L(M) will be printed by the Enumerator we constructed. For any string w in the language L(M) the TM M will run finite number of steps(let it be k for w) to accept it. Then in the k-th step of the Enumerator w will be printed. Thus the Enumerator will print every string M recognizes but a single string may be printed several times. An Enumerable Language is Turing Recognizable It's very easy to construct a Turing Machine M that recognizes the enumerable language L. We can have two tapes. On one tape we take the input string and on the other tape, we run the enumerator to enumerate the strings in the language one after another. Once a string is printed in the second tape we compare it with the input in the first tape. If its a match, then we accept the input, else reject.


References

Computability theory Theory of computation {{compu-stub